package com.sxz.sbs.module.client.presenter;

import com.sxz.sbs.app.App;
import com.sxz.sbs.module.client.bean.CallRecordsBean;
import com.sxz.sbs.module.client.bean.DealScheduleBean;
import com.sxz.sbs.module.client.view.CallRecordsView;
import com.sxz.sbs.module.client.view.DetailsPlanView;
import com.sxz.sbs.rx.RxPresenter;
import com.sxz.sbs.rx.RxSubscriber;
import com.sxz.sbs.rx.RxUtil;

import java.util.HashMap;
import java.util.List;

/**
 * 进度详情
 */
public class DetailsPlanPresenter extends RxPresenter<DetailsPlanView>{
    /**
     * @param map
     */
    public void getDetailsPlan (final HashMap<String,Object> map) {
        addSubscribe(App.getInstance().getApi().getDetailsPlan(map)
                .compose(RxUtil.<List<DealScheduleBean>>handleResult())
                .subscribeWith(new RxSubscriber<List<DealScheduleBean>>(mView){
                    @Override
                    public void onNext(List<DealScheduleBean> data) {
                        mView.onDetailsPlanSuccess(data);
                    }
                })
        );
    }
}
